﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Babelfish.MetaData;

namespace Babelfish.Extensions
{
    public static class MetaDataCollectionExtensions
    {
        /// <summary>
        /// Determines whether [contains] [the specified metadata].
        /// </summary>
        /// <param name="metadata">The metadata.</param>
        /// <param name="predicate">The predicate.</param>
        /// <returns>
        /// 	<c>true</c> if [contains] [the specified metadata]; otherwise, <c>false</c>.
        /// </returns>
        public static bool Contains(this MetaDataCollection metadata, Func<IMetaData, bool> predicate)
        {
            return metadata.Where(predicate).Count() > 0;
        }
    }
}
